import 'package:flutter/material.dart';
import 'package:core_package/core_package.dart';
import 'package:flutter_app_unionad/core/configuration.dart';
import 'package:flutter_app_unionad/model/device_info_model.dart';

class MyFacilityAwaitInstallWidget extends StatelessWidget {
  final Function()? onTap;

  const MyFacilityAwaitInstallWidget({
    Key? key,
    this.onTap,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Positioned.fill(
            child: Image.asset(
          MyAssetsImages.setAssetsImagesPath("icon_login_bg"),
          fit: BoxFit.fill,
          gaplessPlayback: true,
        )),
        Positioned.fill(
          child: Container(
            width: SizeFill.screenWidth,
            height: SizeFill.screenHeight,
            // decoration: BoxDecoration(
            //     image: DecorationImage(
            //   image: AssetImage(,),
            //   fit: BoxFit.fill,
            // )),
            child: SingleChildScrollView(
              child: Column(
                children: [
                  SizedBox(height: SizeFill.statusHeight! + SizeFill.setRx(20)),
                  Image.asset(
                    MyAssetsImages.setAssetsImagesPath("icon_logo_2"),
                    width: SizeFill.setRx(53),
                    height: SizeFill.setRx(50),
                  ),
                  MySizeBox(height: 20),
                  Container(
                    width: SizeFill.setRx(317),
                    height: SizeFill.setRx(525),
                    child: Stack(
                      children: [
                        Positioned.fill(
                          child: Image.asset(MyAssetsImages.setAssetsImagesPath("icon_ficility_bg")),
                        ),
                        Positioned(
                          left: 0,
                          bottom: SizeFill.setRx(88),
                          child: GestureDetector(
                            onTap: () {
                              Configuration().call();
                            },
                            child: Image.asset(
                              MyAssetsImages.setAssetsImagesPath("icon_service"),
                              width: SizeFill.setRx(43),
                              height: SizeFill.setRx(100),
                            ),
                          ),
                        ),
                      ],
                    ),
                  ),
                  MySizeBox(height: 24),
                  GestureDetector(
                    behavior: HitTestBehavior.opaque,
                    onTap: () {
                      if (onTap != null) onTap?.call();
                    },
                    child: Container(
                      width: SizeFill.setRx(317),
                      height: SizeFill.setRx(40),
                      decoration: BoxDecoration(
                        color: Colors.white,
                        borderRadius: BorderRadius.circular(3),
                      ),
                      alignment: Alignment.center,
                      child: Text(
                        "点我开启健康安全饮用水生活吧",
                        style: TextStyle(
                          color: MyColors.formHex("#505050FF"),
                          fontSize: MyFont.font14,
                          fontWeight: MyFontWeight.bold,
                        ),
                      ),
                    ),
                  ),
                  MySizeBox(height: 20),
                ],
              ),
            ),
          ),
        ),
      ],
    );
  }
}
